#pragma once
#include <iostream>
#include <math.h>
using namespace std;
class shape
{
public:
	shape()=default;
	shape(string &n);
	~shape();
	void printMianji();
	void printZhouchang();
	void printName();
protected:
	virtual void printLineLenght()const  = 0;
	virtual double mianji() const =0;
	virtual double zhouchang()const =0;
private:
	string name;
};

class sibianxing :public shape
{
public:
	sibianxing() = default;
	sibianxing(string n, double up, double down, double left, double right);
protected:
	virtual double mianji() const override;
	virtual double zhouchang()const override; 
	virtual void printLineLenght() const override;
private:
	double upLine, downLine, leftLine, rightLine;

};
class tuoyuan :public shape
{
public:
	tuoyuan() = default;
	tuoyuan(string n, double long_r, double short_r);
protected:
	virtual double mianji() const override;
	virtual double zhouchang()const override;
	virtual void printLineLenght() const override;
private:
	double longR,shortR;
	const double pi = 3.1415926;
};
class changfangxing :public sibianxing
{
public:
	changfangxing() = default;
	changfangxing(string n, double width, double height);
};
class zhengfangxing :public changfangxing
{
public:
	zhengfangxing() = default;
	zhengfangxing(string n, double width);
protected:
	virtual double mianji() const override;
	virtual double zhouchang()const override;
private:
	double lineWidth;
};
class circle :public tuoyuan
{
public:
	circle() = default;
	circle(string n, double long_r);

private:
	double longR;
};